package book;
public class Book {     //书的属性
    private String name; //书名
    private String author; //作者
    private  int price;  //价格
    private String type; //书籍类型
    private boolean isborrow; //是否被借出
    public Book(String name, String author, int price, String type) {
        //初始化书的属性
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getAuthor() {
        return author;
    }
    public void setAuthor(String author) {
        this.author = author;
    }
    public int getPrice() {
        return price;
    }
    public void setPrice(int price) {
        this.price = price;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public boolean isIsborrow() {
        return isborrow;
    }
    public void setIsborrow(boolean isborrow) {
        this.isborrow = isborrow;
    }

    @Override
    public String toString() {
        return "Book{" +
                "书名='" + name + '\'' +
                ", 作者='" + author + '\'' +
                ", 价格=" + price +
                ", 类型='" + type + '\'' +
                (isborrow==true?" ,已经借出":" ,未被借出") +
                '}';
    }
}
